home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / pocketd.zip / DEMO.BAT < prev    next >
DOS Batch File  |  1992-05-23  |  13KB  |  412 lines

  1. echo off
  2. cls
  3. d    /Yny// /'//@tThis is a DEMO for &WPocketD&w. Do you want to proceed (Y@/N) ?'
  4. if not errorlevel 2 goto fin
  5. echo This demonstration will only show a very small sample of PocketD's features.
  6. echo It will ignore all files other than the original PocketD release files.        
  7. echo PocketD's internal screen size is set to 80 cols by 11 rows for demonstration
  8. echo purposes. ( THE MENUS BELOW ARE ALL DIRECTLY CONTROLLED BY PocketD ! ).
  9. set d_opt2=/#80,11p:.d.exe/:.d.exe
  10. goto main2
  11.  
  12. :main
  13. cls
  14. echo Returning to main menu..
  15. :main2
  16. d    /Y_123456 /'//@t1. &RColour&w/@t2. DIR formats/@t3. Template/@t4. File info/@t5. File select/@t6. Help//@tESC exit//@t?'
  17. if errorlevel 7 goto help
  18. if errorlevel 6 goto select
  19. if errorlevel 5 goto stats
  20. if errorlevel 4 goto templ
  21. if errorlevel 3 goto disp
  22. if errorlevel 2 goto colour
  23. goto exit
  24.  
  25. :colour
  26. cls
  27. d    /Yny// /'This requires a couple of subdirectories to be created, Ok ?'
  28. if not errorlevel 2 goto skip
  29. md tempdir1
  30. md tempdir2
  31. :skip
  32. echo This will offer a few samples of the many possible options for colour.
  33. echo It will in each case sort names by file/dir "type" to improve the layout.            
  34. echo PocketD ran as:        D /st                            
  35. :col2
  36. d    /Y123/ /'//@tChoose://@t1. Limited colour/@t2. Link Colour to name/@t3. Link Colour to name and fields//@tESC cancel//@t?'
  37. cls
  38. if errorlevel 3 goto 3
  39. if errorlevel 2 goto 2
  40. if errorlevel 1 goto 1
  41. d    /ID tempdir? /zz@
  42. d    /Yn_y /'//@tDiscard last colour scheme selected for further demos ?'
  43. if errorlevel 3 set d_col=
  44. goto main
  45.  
  46. :1
  47. echo This makes very limited use of colours to distinguish files from dirs etc..           
  48. set d_col=wWcW
  49. echo Colours set by:        SET D_COL=wWcW                            
  50. d    /r.0st/.d
  51. echo .
  52. pause
  53. cls
  54. goto col2
  55.  
  56. :2
  57. echo This colours all fields associated with a file/dir with the selected colour
  58. echo for that file/dir type or extension. Subdirs are shown as cyan and executable
  59. echo files in bright red. This is overridden by colours selected for particular
  60. echo extensions and filespecs.                                
  61. set d_col=wwcR----:Y*del*:g.doc:g.gde:g.hlp:y.bat
  62. echo Colours set by:        SET D_COL=wwcR----:Y*del*:g.doc:g.gde:g.hlp:y.bat        
  63. d    /r.0st/.d
  64. echo .
  65. pause
  66. cls
  67. goto col2
  68.  
  69. :3
  70. echo This example also links colour to the file name, but colours the fields 
  71. echo "size" and "date" with their own colour.                                                    
  72. set d_col=wwcRwKWyyWw:Y*del*:g.doc:g.gde:g.hlp:y.bat
  73. echo Colours set by:        SET D_COL=wwcRwKWyyWw:Y*del*:g.doc:g.gde:g.hlp:y.bat            
  74. d    /r.0st/.d
  75. echo .
  76. pause
  77. cls
  78. goto col2
  79.  
  80. :disp
  81. cls
  82. d    /Y1234 /'//@tChoose://@t1. Normal,@/w,@/m and @/t format/@t2. Bestfit/@t3. Subdir summary/@t4. Tailoring//@tESC cancel//@t?'
  83. cls
  84. if errorlevel 4 goto tail
  85. if errorlevel 3 goto subdir
  86. if errorlevel 2 goto bestfit
  87. if errorlevel 1 goto wmt
  88. goto main
  89.  
  90. :wmt
  91. echo This is the default format: standard details sorted by file/dir name            
  92. echo     D                                            
  93. d    
  94. echo .
  95. pause
  96. cls
  97. echo This is the /w "wide" format giving only filename and size in KBytes                                    
  98. echo     D /w                                            
  99. d    /w
  100. echo .
  101. pause
  102. cls
  103. echo This is the /m "minimum" format giving only the filename                                
  104. echo     D /m                                            
  105. d    /m
  106. echo .
  107. pause
  108. cls
  109. echo This is the /t "tiny" format grouping files by extension                                        
  110. echo     D /t                                            
  111. d    /t
  112. echo .
  113. pause
  114. goto disp
  115.  
  116. :bestfit
  117. echo This is the "Best-fit" format which automatically chooses the display format.
  118. echo In this case /w format is chosen to fit the 80x11 format used by the demo.            
  119. echo     D /b                                        
  120. d    /b
  121. echo .
  122. pause
  123. cls
  124. echo This can be modified by "column optimise" (/.k) to limit the No. of columns.
  125. echo In this case the layout is altered to 3 columns which still fits inside 11 rows.        
  126. echo      D /b/.k                                            
  127. d    /b/.k
  128. echo .
  129. pause
  130. goto disp
  131.  
  132. :subdir
  133. echo This demonstrates some of the subdirectory summary features of PocketD
  134. d    /Yny// /'/This will require creation of temporary subdirectories with files/copied into them. Ok ?'
  135. if not errorlevel 2 goto disp
  136. echo      D N*.BAT D*.BAT /cc TEMPDIR1         ( command used for copy/create )        
  137. d    n*.bat d*.bat /cc tempdir1 
  138. echo .
  139. md tempdir2
  140. echo Subdirs TEMPDIR1 and TEMPDIR2 created                                
  141. pause
  142. cls
  143. echo The following uses /r to include a summary of the contents of subdir TEMPDIR1
  144. echo and TEMPDIR2
  145. echo     D /r                                            
  146. d    /r
  147. echo .
  148. pause
  149. cls
  150. echo The following uses /S and /G to group contents of subdirs                    
  151. echo     D /wSG                                        
  152. d    /wSG
  153. echo .
  154. pause
  155. cls
  156. d    /Y// /'//Deleting temporary files.'
  157. echo     D  tempdir1\ tempdir2\    /zd        ( command used to delete )                
  158. d    tempdir1\ tempdir2\ /Ihzd
  159. echo .
  160. pause
  161. goto disp
  162.  
  163. :tail
  164. echo PocketD offers 19 tailoring options. The following shows four of these:        
  165. echo 1. Unbroken names   2. 1jan91 date format   3. Lowercase   4. Sorting by row            
  166. echo     D /.umlr                                        
  167. d    /.umlr
  168. echo .
  169. pause
  170. goto disp
  171.  
  172. :templ
  173. cls
  174. echo PocketD has a very powerful TEMPLATE facility that can be used for display
  175. echo or execution purposes. It can accept 40 possible parameters, a few shown below.
  176. d    /Y12// /'//@tChoose://@t1. Display output/@t2. Execution//@tESC cancel//@t?'
  177. cls
  178. if errorlevel 2 goto t_exec
  179. if errorlevel 1 goto t_disp
  180. goto main
  181.  
  182. :t_disp
  183. echo The display template can be used in many ways. The simple example at the
  184. echo bottom of the screen simply outputs an X for each matching file/dir.            
  185. echo     D /w                                        
  186. d    /w
  187. echo .                                            
  188. echo     D [X]                                        
  189. d    [X]
  190. echo .
  191. pause
  192. cls
  193. echo The template can accept parameters such as $f giving the filename            
  194. echo     D [$f ]                                        
  195. d    [$f ]
  196. echo .
  197. echo It can also accept formatted field widths e.g. $16f for padding to width 16        
  198. echo     D [$16f]                                    
  199. d    [$16f]
  200. echo .
  201. pause
  202. cls
  203. echo $10n gives only the name part without the extension, padded to width 10:            
  204. echo    D [$10n]                                        
  205. d    [$10n]
  206. echo .
  207. echo "//" in the template will add a newline:                        
  208. echo     D ?????.* [$10n//]                                    
  209. d    ?????.* [$10n//]
  210. echo .
  211. pause
  212. goto templ
  213.  
  214. :t_exec
  215. echo PocketD can be used to run a template for a selected group of files. For
  216. echo example, the following could be used to move each file extension group to
  217. echo its own archive file:
  218. echo (R? below causes PocketD to echo each line without running it. R runs).        
  219. echo     D /e [PKZIP -m $e *.$e]R?                                
  220. d    /e [PKZIP -m $e *.$e]R?
  221. echo .
  222. pause
  223. cls
  224. echo PocketD can run multi-line sequences. e.g. To move each file extension
  225. echo group to its own subdir, named by the extension:                        
  226. echo     D /e [md $e//copy *.$e $e]R?
  227. D    /e [md $e//copy *.$e $e]R?
  228. echo .
  229. pause
  230. goto templ
  231.  
  232. :stats
  233. cls
  234. echo PocketD can provide additional information about files and present file
  235. echo data in a number of ways. The following gives a few examples of this.
  236. d    /Y123// /'//@tChoose://@t1. Barchart display/@t2. Execution size && Compression/@t3. Extension summary//@tESC cancel//@t?'
  237. cls
  238. if errorlevel 3 goto exten
  239. if errorlevel 2 goto exec
  240. if errorlevel 1 goto bar
  241. goto main
  242.  
  243. :bar
  244. echo The following chart show the relative size of all files represented as a
  245. echo bar chart. *.BAT files are excluded to reduce the number of files displayed.            
  246. echo     D /g- *.BAT                                        
  247. d    /g- *.bat
  248. echo .
  249. pause
  250. cls
  251. echo The chart is improved by sorting the files by size (ss) & showing the relative
  252. echo percentage usage of each (%%). It also shows the size in terms of space used
  253. echo rather than actual size (U).                            
  254. echo     D /ss /%%U /g- *.BAT       (or D /ss/%Ug- *.BAT etc..)                    
  255. d    /ss/%%Ug- *.bat
  256. echo .
  257. pause
  258. goto stats
  259.  
  260. :exec
  261. echo PocketD can show the minimum run size of an EXE program in KBytes using /M.
  262. echo Executable files can be compressed by PKLITE, DIET and LZEXE. The /C option
  263. echo will show files that are compressed by flagging the attribute as p,d or l        
  264. echo     D /EMC            ( E=executable  M=exec size  C=Compress check )            
  265. d    /EMC
  266. echo .
  267. pause
  268. goto stats
  269.  
  270. :exten
  271. echo PocketD can summarise files and subdirs by EXTENSION, allowing the user
  272. echo to assess the space used by each extension present.                
  273. echo    D /e                                        
  274. d    /eh.2
  275. echo .                                            
  276. echo This could be used with other options to provide further information. e.g.
  277. echo Showing only the top 4 extensions (in terms of size) and plotting a barchart.    
  278. echo    D /eK.4g%%/ss        (K.4 = 1st 4, /ss = sort by size, g = barchart)        
  279. d    /eK.4g%%/ss/h.2
  280. echo .
  281. pause
  282. goto stats
  283.  
  284. :select
  285. cls
  286. echo PocketD can apply many criteria for selecting files and subdirectories.                
  287. d    /Y123 /'/@tChoose://@t1. Filespecs/@t2. Size/@t3. String searching//@tESC cancel//@t?'
  288. cls
  289. if errorlevel 3 goto string
  290. if errorlevel 2 goto size
  291. if errorlevel 1 goto filesp
  292. goto main
  293.  
  294. :filesp
  295. echo PocketD uses a generalised filespec system that can include and exclude names.
  296. echo The following shows all executable files in the current directory:            
  297. echo  D /mhE/.u       ( m=minimum  h=no header  E=executable  /.u=unbroken names )            
  298. d    /mhE/.u
  299. echo.
  300. echo The group of files selected can be reduced using filespecs:            
  301. echo  D /mhE/.u *L*A* E*        ( Only names with an L followed later by A
  302. echo                      or starting with the letter E )            
  303. d    /mhE/.u *L*A* E*
  304. echo .
  305. echo The command line can also include "exclusion" filespecs:            
  306. echo  D /mhE/.u *L*A* E* /- *D* ??L*        ( also excluding all names containing D
  307. echo                          or the letter L as the 3rd character)
  308. d    /mhE/.u *L*A* E* /- *D* ??L*
  309. echo .
  310. pause
  311. cls
  312. echo PocketD also allows "type" specifications in filenames, for example:        
  313. echo  D *=D* *=n* /hm                                    
  314. d    *=D* *=n* /hm
  315. echo .                                            
  316. echo This uses "=D" to match any name containing a digit, and "=n" to match
  317. echo any name that contains a non-alphanumeric character (uppercase indicates 
  318. echo match, lowercase for non-match). Also supported: =A/=a match alpha/non-alpha.        
  319. pause
  320. goto select
  321.  
  322. :size
  323. echo PocketD can select files by size (and also date, See D /??).
  324. echo The following shows all non-executable files sorted by size:                
  325. echo     D /h!Ess    ( h=no header  !E=NOT executable  ss=sort by size )            
  326. d    /h!Ess
  327. echo .
  328. echo A size restriction could be added to this:                    
  329. echo     D /h!Ess/}20000        ( greater or equal to 20000 )                
  330. D    /h!Ess/}20000
  331. echo .
  332. echo This could be replaced by a range 20k to 50k (k=Kilobytes):            
  333. echo     D /h!Ess/}20k{50k                                    
  334. D    /h!Ess/}20k{50k
  335. pause
  336. goto select
  337.  
  338. :string
  339. echo PocketD can select files by the strings they contain (m=minimum  h=no header):            
  340. echo     D *.BAT /mh'not'    ( only *.BAT files containing 'not' )                
  341. d    *.bat /mh'not'
  342. echo .
  343. echo This can be inverted to only those not containing 'not':                
  344. echo     D *.BAT /mh!'not'    ( !'not' = not including 'not' )            
  345. d    *.BAT /mh!'not'
  346. echo .
  347. echo Extra options can be added to show 1st match found, but no dir listing:        
  348. echo     D *.BAT /mh'not'Sd    ( S = show strings  d = no directory )            
  349. d    *.BAT /mh'not'Sd
  350. echo .                                            
  351. pause
  352. cls
  353. echo The string searching facility can be used to search for types of character,
  354. echo for example: Numeric digit, Alphabetic, Alpha-numeric, space characters etc..    
  355. echo     D *.BAT /hm'subdir'Sd    ( files containing the string 'subdir' )            
  356. d    *.bat /hm'subdir'Sd
  357. echo .
  358. echo This could be modified to find files with 'subdir' but not 'subdirectory':        
  359. echo     D *.BAT /hm'subdir@a'Sd    ( @a = non-alphabetic character )            
  360. d    *.bat /hm'subdir@a'Sd
  361. echo .
  362. echo Other options include L/l show/don't show line numbers, * show all strings
  363. echo and "" instead of '' for case-insensitive search.
  364. pause
  365. goto select
  366.  
  367. :help
  368. cls
  369. echo PocketD comes with a number of documentation files. This demo only gives access
  370. echo to the on-line help. the remaining files can be read by typing the line:
  371. echo "D FEATURE.CMP README.D /q" from the DOS prompt.                    
  372. echo 1. The single page help, accessed by D /?
  373. pause
  374. d /?
  375. pause>nul
  376. cls
  377. echo 2. The general documentation, assessed by D /?doc
  378. pause
  379. d /?doc
  380. cls
  381. echo 3. The User Guide, assessed by D /??
  382. pause
  383. d /??
  384. cls
  385. echo 4. The on-line manual, given for the example D /?e                    
  386. d /?e
  387. goto main
  388.  
  389. :exit
  390. cls
  391. echo DEMO terminated                                    
  392. echo This demonstration has not covered the following major features:            
  393. echo .  COPY/MOVE facilities, including copy to multi-disk, conditional copy,
  394. echo    multiple sources, subtree copying and "safe" copy features.
  395. echo .  ARCHIVE viewing and searching in ZIP/ARC/ZOO/LZH/ARJ/PAK archives
  396. echo .  Using PocketD to emulate utilities such as NCD, WHICH and MAKE etc..
  397. echo .  Using the separate display and execution TEMPLATE(s) to create utilities
  398. echo    that can intelligently interact with the user.
  399. echo .  ENVIRONMENT VARIABLE analysis from command line. e.g. D :PATH
  400. echo .  FILE SEARCH across multiple drives/subdirs using multiple criteria
  401. echo .  TOUCH and full ATTRIB modification of files
  402. echo .  ON-LINE FILE VIEWER in HEX or TEXT, providing text searching.
  403. echo .  ON-LINE BROWSING of file lists
  404. echo .  The 37 USER-DEFINED parameter names                            
  405. echo You are referred to the on-line guide accessed by typing D /?? for these.        
  406.  
  407. set d_opt2=
  408. if "%d_col%"=="" goto fin
  409. d    /Yn_y/ /'/Discard current colour scheme for use after DEMO ?'
  410. if errorlevel 3 set d_col=
  411. :fin
  412.